#!/usr/bin/env python
# Nonblocking I/O - chapter 5 - pollclient.py

import socket, sys, select

port = 51423
host = 'localhost'

spinsize = 10
spinpos = 0
spindir = 1

def spin():
    global spinsize, spinpos, spindir
    spinstr = '.' * spinpos + \
        '|' + '.' * (spinsize - spinpos -1)
    sys.stdout.write('\r')